<%-- 
    Document   : MyCarBook
    Created on : Nov 2, 2011, 12:00:40 AM
    Author     : MrKoi
--%>

<%@page import="DAL.CarBookBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib uri="/WEB-INF/taglib139.tld" prefix="pg" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
        <style type="text/css">
            #Table
            {
                border:1px solid #999999;
            }
            th
            {
                border:1px solid #cccccc;
            background-color:#666666;
            color:white;
            }
            .td
            {
                border:1px solid #cdcccc;
            }
            .font
            {
            font-family:"Times New Roman", Times, serif;
            font-size:x-large;
            font-weight:bold;
            width:200px;
            margin-left:auto;
            margin-right:auto;
            color:#0707e7;
            }
        </style>
    </head>
    <body>
    <%
        String user="";
        if(session.getAttribute("User")!=null)
         {
                 user=session.getAttribute("User").toString();
                 CarBookBean cbb=new CarBookBean();
                 Collection coll=cbb.ListMyCB(user);
                 request.setAttribute("carb",coll);   
                // if(coll.size()>0)
                //     {
           }              
     %>
       
    
    <center>
                <span style="font-size: 20px;color: #343434;">List Of Car Rental</span></center> 
    <table width="510px" id="Table">  
        <tr>
            <th>Car Name</th>
            <th>Image</th>
            <th>Driver</th>
            <th>Pick Up Date</th>
            <th>Drop Off Date</th>
            <th>Time</th>
            <th>Tatol money</th>
            <th>DateBook</th>
            <th>Cancel</th>
        </tr>
        <pg:paging pageSize="5" url="management.jsp?page=CarCancel"  >
        <c:forEach items="${carb}" var="cr">
            <pg:item>
        <tr>
            <td class="td">${cr.carName}</td>
            <td class="td" width="50px"><img src="${cr.image}" width="50px" height="30px"/></td>
            <td class="td">${cr.driver}</td>
            <td class="td">${cr.pickUpDate}</td>
            <td class="td">${cr.dropOffDate}</td>
            <td class="td">${cr.time}</td>
            <td class="td"><f:formatNumber value="${cr.totalMoney}" pattern="$#,###" /></td>            
            <td class="td">${cr.dateBooking}</td>           
            <td class="td" width="60px">
                <form action="ControllerCancelCarBook" method="post" name="cancel">
                    <input type="hidden" name="bookingID" value="${cr.bookingID}" />
                    <input type="submit" name="cancel" value="Cancel" OnClick="return confirm('Are you sure you want cancel booking car this?');"/>
                </form>
            </td>
        </tr>
    </pg:item>       
    </c:forEach>
        <pg:index>
          <pg:page><%=thisPage%></pg:page>
        </pg:index>
    </pg:paging>
    </table>
    
    </body>
</html>
